package org.example.demo1startjava17.demo.demo;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class MyClass0 implements InitializingBean {

    protected List<String> list;

    @Override
    public void afterPropertiesSet() throws Exception {
        list = new ArrayList<>();
        list.add("1");
        list.add("2");
        list.add("3");
    }

    public void printList() {
        list.forEach(System.out::println);
    }

}
